<?php
include('../mysqli_connect.php');
$teamName = $_GET['teamName'];

$sql = "select p.player_name from player p,(select team_id from team where team_name='{$teamName}') t where t.team_id=p.team_id;";
$res = mysqli_query($dbc, $sql);
if (!$res) {
  $response = array('status' => false, 'message' => mysqli_error($dbc));
  echo json_encode($response);
}
$resultArray = array();
$i = 0;
while ($row = mysqli_fetch_row($res)) {
  // $resultArray[] = $row;
  $resultArray[$i] = $row[0];
  $i = $i + 1;
}

$response = array('status' => true, 'message' => '获取小组队伍成功', 'data' => $resultArray);
echo json_encode($response);
